import store from "@/store";

export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

import dayjs from "dayjs";
// 表单配置项
export const formBase = [
  {
    label: "时间",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    type: "input",
    field: "userName",
    label: "会员昵称",
  },
  // 订单类型：0:在线下单 1:后台下单 2:同行导出 3:APP端 4:公众号下单

  {
    type: "select",
    field: "orderType",
    label: "订单类型",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "在线下单",
        value: 0,
      },
      {
        label: "后台下单",
        value: 1,
      },
      {
        label: "同行导出",
        value: 2,
      },
      {
        label: "APP端",
        value: 3,
      },
      {
        label: "公众号下单",
        value: 4,
      },
    ],
  },
  {
    label: "仓库",
    type: "select",
    field: "affiliationWarehouse",
    optionsKey: "warehouseName",
    optionsValue: "id",
    options: store.state.custom_dict.warehouse,
  },
  {
    label: "店铺",
    type: "select",
    field: "shop",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop,
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "收款员工",
    prop: "collectionStaff",
  },
  {
    label: "订单数量",
    prop: "orderNum",
    width: 140,
  },
  {
    label: "快递数量",
    prop: "deliveryNum",
    width: 200,
  },
  {
    label: "费用",
    prop: "cost",
    width: 140,
  },
  {
    label: "重量",
    prop: "weight",
    width: 140,
  },
];

// 表格配置项
export const tableBase2 = [
  {
    label: "订单号",
    prop: "orderNo",
    width: 200,
  },
  {
    label: "店铺",
    prop: "ownedStore",
    width: 140,
  },
  {
    label: "订单类型",
    prop: "orderType",
    slotName: "orderType",
    width: 200,
  },
  {
    label: "收款时间",
    prop: "recipientTime",
    width: 140,
  },
  {
    label: "收款员",
    prop: "recipientName",
    width: 140,
  },
  {
    label: "订单时间",
    prop: "createTime",
    width: 140,
  },
  {
    label: "运费",
    prop: "shippingFee",
    width: 140,
  },
  {
    label: "费用",
    prop: "dueFee",
    width: 140,
  },
  {
    label: "会员",
    prop: "userName",
    width: 140,
  },
  {
    label: "重量",
    prop: "weight",
    width: 140,
  },
];
